
package ProOF.apl.problems.real.operators;

import ProOF.apl.problems.real.RealCodification;
import ProOF.apl.problems.real.RealProblem;
import ProOF.gen.operator.oInitializer;
import ProOF.utilities.uUtil;

/**
 *
 * @author Hossomi
 */
public class RealInitRandom extends oInitializer<RealProblem, RealCodification> {

    @Override
    public String name() {
        return "Random";
    }
    
    @Override
    public void initialize(RealProblem prob, RealCodification ind) throws Exception {
        for (int i = 0; i < prob.func.dimension(); i++) {
            if (ind.x == null)
                System.out.println("x is null");
            else if (prob.func == null)
                System.out.println("func is null");
            ind.x[i] = prob.rmd.nextDouble(prob.func.min(i), prob.func.max(i));
        }
    }

}
